namespace Tequila.Phone.Sharing.Twitter
{
    /// <summary>
    /// Twitter service authorization session.
    /// </summary>
    public sealed class TwitterAuthorizationSession
    {
        /// <summary/>
        public string CallbackUrl { get; set; }

        /// <summary/>
        public string ConsumerKey { get; set; }

        /// <summary/>
        public string ConsumerSecret { get; set; }

        /// <summary>
        /// Determines whether session is in valid state or not.
        /// </summary>
        public bool IsValid
        {
            get
            {
                return !string.IsNullOrEmpty(ConsumerKey)
                       && !string.IsNullOrEmpty(ConsumerSecret)
                       && !string.IsNullOrEmpty(CallbackUrl);
            }
        }

        /// <summary>
        /// Closes session by means of cleaning session internal state.
        /// </summary>
        public void Close()
        {
            ConsumerKey = null;
            ConsumerSecret = null;
        }
    }
}